body {
    font-family: Arial, sans-serif;
    background-color: #140b0b;
    color: #fff;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.scrolled {
background-color: #140b0b;
}    

.gallery {
display: grid;
/* grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); */
grid-template-columns: repeat(3, 1fr);
gap: 20px; /* Equal gap between items horizontally and vertically */
padding: 20px;
margin-top: 70px;
width: 90%;
margin-left: auto;
margin-right: auto;
}

.gallery-item {
position: relative;
aspect-ratio: 3 / 2; /* Maintains a 3:2 aspect ratio */
overflow: hidden;
}


.gallery-item img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease;
}

.gallery-item img.after {
    opacity: 0;
}

.gallery-item:hover img.after {
    opacity: 1;
}

.gallery-item:hover img.before {
    opacity: 0;
}

.gallery-text {
    position: absolute;
    width: 100%;
    top: 10px;
    left: 10px;
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    transition: opacity 0.5s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.gallery-text.after {
    opacity: 0;
}

.gallery-item:hover .gallery-text.after {
    opacity: 1;
}

.gallery-item:hover .gallery-text.before {
    opacity: 0;
}
@media screen and (max-width: 1000px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    .gallery-item img.after {
        opacity: 1;
    }
    .gallery-text {
        display: none;
    }
    
}
@media screen and (max-width: 600px) {
    .gallery {
        grid-template-columns: repeat(1, 1fr);
    }
    
}